<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>

</body>
<script>
  class Star {
    constructor(uname, age) {
      this.uname = uname
      this.age = age
    }
    sing(song) {
      console.log(this.uname + song)
    }
  }
  var ldh = new Star('刘德华', '17')
  var zxy = new Star('张学友', '18')
  ldh.sing('冰雨')
  zxy.sing('吻别')
</script>

</html>